#!/usr/bin/env node

const http=require('http');

http.createServer((req,res)=>{
  if(req.url='/'){
    let buf=Buffer.from('<html><head></head><body><h1>hello朱怡桐</h1></body></html>');
    res.setHeader('Content-Type','text/html;charset=utf-8');
    res.setHeader('Content-Length',`${buf.byteLength}`);
    res.end(buf.toString('utf8'));
  }else{
    res.statusCode=404;
    res.end('page not found!');
  }
}).listen(3000)
